package addon.w3.mdx.com;

import java.io.IOException;

import addon.w3.mdx.LEDataInputStream;
import addon.w3.mdx.MDXException;
import addon.w3.mdx.MDXParentCOM;

/**
 * TXAN						// [Texture Animations]
	long 	nbytes;
	struct {
		long	nbytesi;
		(KTAT)				// Might be optional
		(KTAR)
		(KTAS)
	} txanims[nanims];
 * @author madjk
 *
 */
public class MDXTAnim extends MDXParentCOM {
	int length = -1;
	MDXTAnimCOM coms[] = null;
	
	public String getTag() {
		return "TXAN";
	}
	
	public void _decode(LEDataInputStream ins) throws IOException, MDXException {
		length = ins.readInt();
		ins.skip(length);
//		coms = new MDXTAnimCOM[length/268];
//		for(int i=0;i<coms.length;i++) {
//			coms[i] = new MDXTAnimCOM();
//			coms[i].decode(ins);
//			System.out.println(coms[i]);
//		}
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("TAG : "+getTag());
		sb.append("\n\tELEN : "+length);
		if(coms != null && coms.length > 0) sb.append("\n\tTEXTURE ANIMATIONS[] : "+coms.length);
		return sb.toString();
	}

	@Override
	public boolean isImplicitTag() {
		// TODO Auto-generated method stub
		return true;
	}
}